package cn.hiapi.shopkeeper.entity.activity;

import cn.hiapi.basic.entity.BasicEntity;
import cn.hiapi.basic.serializer.LongToStringSerializer;
import com.alibaba.fastjson.annotation.JSONField;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Getter;
import lombok.Setter;
import org.hibernate.annotations.GenericGenerator;

import javax.persistence.*;
import java.math.BigDecimal;

/**
 * @author AdinZ
 * @date 2023/2/4 14:59
 */
@Entity
@Table(name = "hiapi_shopkeeper_activity_lottery_ad")
@ApiModel(description = "抽奖活动广告")
@Getter
@Setter
public class ActivityLotteryAd extends BasicEntity {

    @Id
    @GeneratedValue(generator = "snowflake")
    @GenericGenerator(name = "snowflake", strategy = "cn.hiapi.basic.id.SnowflakeId")
    @JSONField(serializeUsing = LongToStringSerializer.class)
    private Long id;
    @ApiModelProperty("店铺id")
    private long shopId;
    private String title;
    private String thumb;
    @ApiModelProperty("原价")
    @Column(columnDefinition = "decimal(10,2)")
    private BigDecimal price = BigDecimal.ZERO;

    private String dayStart;

    private String dayEnd;

    @ApiModelProperty("小时数量")
    private int timeNum=1;

    @ApiModelProperty("开始时间")
    private long startTime;
    @ApiModelProperty("结束时间")
    private long endTime;
    @ApiModelProperty("使用开始时间")
    private long useStart;
    @ApiModelProperty("使用结束时间")
    private long useEnd;
    @ApiModelProperty("奖品数量")
    private int stockNum;
    @ApiModelProperty("状态 0未开始,1开始,2结束")
    private int status;
    @ApiModelProperty("支付金额")
    @Column(columnDefinition = "decimal(10,2)")
    private BigDecimal payMoney;
    @ApiModelProperty("单价")
    @Column(columnDefinition = "decimal(10,2)")
    private BigDecimal feePrice;


    @ApiModelProperty("付款状态 0未付款,1已付款")
    private int payStatus;
    @ApiModelProperty("创建时间")
    private long created = System.currentTimeMillis();
    @ApiModelProperty("更新时间")
    private long updated = System.currentTimeMillis();

    @ApiModelProperty("活动详情")
    @Column(columnDefinition = "text")
    private String body;
}
